//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package javax.vpncrypto.spec;

import java.security.InvalidKeyException;
import java.security.spec.KeySpec;

public class DESedeKeySpec implements KeySpec {
    public static final int DES_EDE_KEY_LEN = 24;
    private byte[] key;

    public DESedeKeySpec(byte[] var1) throws InvalidKeyException {
        this(var1, 0);
    }

    public DESedeKeySpec(byte[] var1, int var2) throws InvalidKeyException {
        if (var1.length - var2 < 24) {
            throw new InvalidKeyException("Wrong key size");
        } else {
            this.key = new byte[24];
            System.arraycopy(var1, var2, this.key, 0, 24);
        }
    }

    public byte[] getKey() {
        return (byte[])this.key.clone();
    }

    public static boolean isParityAdjusted(byte[] var0, int var1) throws InvalidKeyException {
        if (var0.length - var1 < 24) {
            throw new InvalidKeyException("Wrong key size");
        } else {
            return javax.vpncrypto.spec.DESKeySpec.isParityAdjusted(var0, var1) && javax.vpncrypto.spec.DESKeySpec.isParityAdjusted(var0, var1 + 8) && DESKeySpec.isParityAdjusted(var0, var1 + 16);
        }
    }
}
